import { configureStore, getDefaultMiddleware } from "@reduxjs/toolkit";
import { setupListeners } from "@reduxjs/toolkit/dist/query";
import { authApi } from "./api/authApi";
import { authSlice } from "./reducer/authSlice";

const store = configureStore({
    reducer: {
        [authApi.reducerPath]: authApi.reducer,
        auth: authSlice.reducer
    },
    // middleware: (curryGetDefaultMiddleware().concat(authApi.middleware))
    middleware: (getDefaultMiddleware().concat(authApi.middleware))
})
setupListeners(store.dispatch)

export default store